#!/usr/bin/python
# -*- coding: utf-8 -*-
# @File: task.py
# @Author: Liccsu
# @Time: 13/8/2022 下午1:46
# @Project: eschool-health

try:
    from signin import hs
    from sendmail import sm
except ModuleNotFoundError or ImportError:
    from .signin import hs
    from .sendmail import sm


class Task:
    @staticmethod
    def time_task():
        try:
            res = hs.get_detail()
            if res['success']:
                res2 = hs.do_detail(data=res['data'])
                if res2['success']:
                    sm.send_success(res)
                else:
                    sm.send_failed(res2)
            else:
                sm.send_failed(res)
        except Exception as e:
            sm.send_error(e)


if __name__ == '__main__':
    Task.time_task()
